// 导入自己封装的axios实例对象
import request from '@/utils/request'

// 获取文章列表
export const getArticleList = params=>{
  return request({
    url:'/v1_0/articles',
    params
  })
}

// 获取文章的详情
export const getArticleDetail = id =>{
  return request({
    url:'/v1_0/articles/'+id,
  })
}

// 文章收藏
export const addArticleCollect = data=>{
  return request({
    url:'/v1_0/article/collections',
    method:'post',
    data
  })
}

// 取消收藏文章
export const deleteArticleCollect = target=>{
  return request({
    url:'/v1_0/article/collections/'+target,
    method:'delete',
  })
}


// 文章点赞
export const addArticleZan = data=>{
  return request({
    url:'/v1_0/article/likings',
    method:'post',
    data
  })
}

// 取消文章点赞
export const deleteArticleZan = target=>{
  return request({
    url:'/v1_0/article/likings/'+target,
    method:'delete',
  })
}
